# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=py3-pygraphviz
pkgver=1.13
pkgrel=0
pkgdesc="Python interface to Graphviz"
options="!check" # FAILED (failures=11, errors=47)
url="https://pygraphviz.github.io/"
arch="all"
license="BSD-3-Clause"
depends="python3"
makedepends="python3-dev graphviz-dev py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-nose"
subpackages="$pkgname-pyc"
source="https://github.com/pygraphviz/pygraphviz/archive/pygraphviz-$pkgver.tar.gz"
builddir="$srcdir/pygraphviz-pygraphviz-$pkgver"

replaces="py-pygraphviz" # Backwards compatibility
provides="py-pygraphviz=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	gpep517 build-wheel \
		--wheel-dir dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --system-site-packages testenv
	testenv/bin/python3 -m installer dist/*.whl
	testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		dist/*.whl
}

sha512sums="
7edc61d2e6ff6a403aa5c26f45e5bb779d007f8a34d941800e3d4393639eed14f43fd9cd39f6415d7ece55450d2fbc2644269e36dffc60d87c36ba3794c350b2  pygraphviz-1.13.tar.gz
"
